﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraLayout;
    using DevExpress.XtraLayout.Utils;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using HRM.CORE;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;

    public class xfmDecrease : XtraForm
    {
        private SimpleButton btClose;
        private SimpleButton btDecrease;
        private SimpleButton btNext;
        private CalcEdit calRate;
        private GridColumn colInsuranceTableListName;
        private IContainer components;
        private DateEdit dateEdit2;
        private DataTable dt_Employee;
        private DateEdit dtToDate;
        private GridLookUpEdit glkInsuranceTableList;
        private GridView gridLookUpEdit1View;
        private GroupControl groupControl1;
        private DevExpress.Utils.ImageCollection imageCollection1;
        private LayoutControl layoutControl1;
        private LayoutControlGroup layoutControlGroup1;
        private LayoutControlItem layoutControlItem1;
        private LayoutControlItem layoutControlItem2;
        private LayoutControlItem layoutControlItem3;
        private LayoutControlItem layoutControlItem4;
        private LayoutControlItem layoutControlItem5;
        private LayoutControlItem layoutControlItem6;
        private LayoutControlItem layoutControlItem7;
        private int m_Count;
        private string m_Description;
        private string m_EmployeeCode;
        private string m_EmployeeName;
        private System.DateTime m_FromDate;
        private string m_HealthInsuranceCode;
        private string m_Hospital;
        private string m_IDCard;
        private Guid m_InsuranceID;
        private Guid m_InsuranceTableListID;
        private bool m_IsPay;
        private string m_MainAddress;
        private decimal m_NewAllowance1;
        private decimal m_NewAllowance2;
        private decimal m_NewAllowance3;
        private decimal m_NewAllowance4;
        private decimal m_NewSalary;
        private decimal m_OldAllowance1;
        private decimal m_OldAllowance2;
        private decimal m_OldAllowance3;
        private decimal m_OldAllowance4;
        private decimal m_OldSalary;
        private string m_Province;
        private double m_Rate;
        private bool m_Sex;
        private string m_SocialInsuranceCode;
        private System.DateTime m_ToDate;
        private int m_Type;
        private RadioGroup radioGroup1;
        private RadioGroup radioGroup2;
        private MemoEdit txtDescription;

        public event CreatedEventHander Created;

        public xfmDecrease()
        {
            this.components = null;
            this.m_Count = 0;
            this.InitializeComponent();
            this.Init();
        }

        public xfmDecrease(DataTable Employee)
        {
            this.components = null;
            this.m_Count = 0;
            this.InitializeComponent();
            this.dt_Employee = Employee;
            this.m_Count = this.dt_Employee.Rows.Count - 1;
            this.Init();
        }

        private void AddComboboxEdit(ComboBoxEdit combo, string str)
        {
            combo.Properties.Items.Add(str);
            combo.SelectedIndex = combo.Properties.Items.Count - 1;
        }

        private void btClose_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btDecrease_Click(object sender, EventArgs e)
        {
            if (this.glkInsuranceTableList.EditValue == null)
            {
                XtraMessageBox.Show("Vui l\x00f2ng chọn đợt b\x00e1o c\x00e1o cần ph\x00e1t sinh!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                HRM_INSURANCE hrm_insurance = new HRM_INSURANCE();
                if (this.InitClass().Insert() == "OK")
                {
                    if (this.btNext.Enabled)
                    {
                        this.SetValue(this.m_Count);
                    }
                    else
                    {
                        XtraMessageBox.Show("Dữ liệu ph\x00e1t sinh đ\x00e3 được lưu lại!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        this.RaiseCreatedEventHander();
                        base.Close();
                    }
                }
                else
                {
                    XtraMessageBox.Show("Dữ liệu kh\x00f4ng được lưu!\nVui l\x00f2ng kiểm tra lại!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
            }
        }

        private void btNext_Click(object sender, EventArgs e)
        {
            this.SetValue(this.m_Count);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void glk_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            xfmInsuranceAdd.AddedEventHander hander = null;
            if (e.Button.Kind == ButtonPredefines.Glyph)
            {
                GridLookUpEdit edit = sender as GridLookUpEdit;
                string name = edit.Name;
                if ((name != null) && (name == "glkInsuranceTableList"))
                {
                    xfmInsuranceAdd add = new xfmInsuranceAdd(Actions.Add);
                    if (hander == null)
                    {
                        hander = (s, i) => new HRM_INSURANCE_TABLELIST().AddGridLookupEdit(this.glkInsuranceTableList);
                    }
                    add.Added += hander;
                    add.ShowDialog();
                }
            }
        }

        private void Init()
        {
            this.InitData();
            this.SetValue(this.m_Count);
        }

        private HRM_INSURANCE InitClass()
        {
            return new HRM_INSURANCE { 
                InsuranceID = Guid.NewGuid(), InsuranceTableListID = new Guid(this.glkInsuranceTableList.EditValue.ToString()), EmployeeCode = this.m_EmployeeCode, EmployeeName = this.m_EmployeeName, Sex = this.m_Sex, IDCard = this.m_IDCard, MainAddress = this.m_MainAddress, OldSalary = this.m_OldSalary, OldAllowance1 = this.m_OldAllowance1, OldAllowance2 = this.m_OldAllowance2, OldAllowance3 = this.m_OldAllowance3, OldAllowance4 = this.m_OldAllowance4, NewSalary = this.m_NewSalary, NewAllowance1 = this.m_NewAllowance1, NewAllowance2 = this.m_NewAllowance2, NewAllowance3 = this.m_NewAllowance3, 
                NewAllowance4 = this.m_NewAllowance4, Type = this.m_Type, IsPay = this.m_IsPay, SocialInsuranceCode = this.m_SocialInsuranceCode, HealthInsuranceCode = this.m_HealthInsuranceCode, Province = this.m_Province, Hospital = this.m_Hospital, Rate = double.Parse(this.calRate.EditValue.ToString()), ToDate = this.dtToDate.DateTime, Description = this.txtDescription.Text
             };
        }

        private void InitData()
        {
            new HRM_INSURANCE_TABLELIST().AddGridLookupEdit(this.glkInsuranceTableList);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xfmDecrease));
            SerializableAppearanceObject appearance = new SerializableAppearanceObject();
            this.groupControl1 = new GroupControl();
            this.layoutControl1 = new LayoutControl();
            this.glkInsuranceTableList = new GridLookUpEdit();
            this.gridLookUpEdit1View = new GridView();
            this.colInsuranceTableListName = new GridColumn();
            this.dateEdit2 = new DateEdit();
            this.radioGroup2 = new RadioGroup();
            this.dtToDate = new DateEdit();
            this.radioGroup1 = new RadioGroup();
            this.txtDescription = new MemoEdit();
            this.layoutControlGroup1 = new LayoutControlGroup();
            this.layoutControlItem1 = new LayoutControlItem();
            this.layoutControlItem2 = new LayoutControlItem();
            this.layoutControlItem3 = new LayoutControlItem();
            this.layoutControlItem4 = new LayoutControlItem();
            this.layoutControlItem5 = new LayoutControlItem();
            this.layoutControlItem6 = new LayoutControlItem();
            this.btDecrease = new SimpleButton();
            this.imageCollection1 = new DevExpress.Utils.ImageCollection(this.components);
            this.btClose = new SimpleButton();
            this.btNext = new SimpleButton();
            this.calRate = new CalcEdit();
            this.layoutControlItem7 = new LayoutControlItem();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.layoutControl1.BeginInit();
            this.layoutControl1.SuspendLayout();
            this.glkInsuranceTableList.Properties.BeginInit();
            this.gridLookUpEdit1View.BeginInit();
            this.dateEdit2.Properties.VistaTimeProperties.BeginInit();
            this.dateEdit2.Properties.BeginInit();
            this.radioGroup2.Properties.BeginInit();
            this.dtToDate.Properties.VistaTimeProperties.BeginInit();
            this.dtToDate.Properties.BeginInit();
            this.radioGroup1.Properties.BeginInit();
            this.txtDescription.Properties.BeginInit();
            this.layoutControlGroup1.BeginInit();
            this.layoutControlItem1.BeginInit();
            this.layoutControlItem2.BeginInit();
            this.layoutControlItem3.BeginInit();
            this.layoutControlItem4.BeginInit();
            this.layoutControlItem5.BeginInit();
            this.layoutControlItem6.BeginInit();
            this.imageCollection1.BeginInit();
            this.calRate.Properties.BeginInit();
            this.layoutControlItem7.BeginInit();
            base.SuspendLayout();
            this.groupControl1.Controls.Add(this.layoutControl1);
            this.groupControl1.Dock = DockStyle.Top;
            this.groupControl1.Location = new Point(0, 0);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.ShowCaption = false;
            this.groupControl1.Size = new Size(0x1ab, 0xef);
            this.groupControl1.TabIndex = 0;
            this.groupControl1.Text = "Th\x00f4ng tin";
            this.layoutControl1.Controls.Add(this.calRate);
            this.layoutControl1.Controls.Add(this.glkInsuranceTableList);
            this.layoutControl1.Controls.Add(this.dateEdit2);
            this.layoutControl1.Controls.Add(this.radioGroup2);
            this.layoutControl1.Controls.Add(this.dtToDate);
            this.layoutControl1.Controls.Add(this.radioGroup1);
            this.layoutControl1.Controls.Add(this.txtDescription);
            this.layoutControl1.Dock = DockStyle.Fill;
            this.layoutControl1.Location = new Point(2, 2);
            this.layoutControl1.Name = "layoutControl1";
            this.layoutControl1.Root = this.layoutControlGroup1;
            this.layoutControl1.Size = new Size(0x1a7, 0xeb);
            this.layoutControl1.TabIndex = 1;
            this.layoutControl1.Text = "layoutControl1";
            this.glkInsuranceTableList.Location = new Point(0x6c, 0xc7);
            this.glkInsuranceTableList.Name = "glkInsuranceTableList";
            this.glkInsuranceTableList.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("glkInsuranceTableList.Properties.Buttons"), new KeyShortcut(Keys.None), appearance, "", null, null, true) });
            this.glkInsuranceTableList.Properties.NullText = "[Chọn đợt b\x00e1o c\x00e1o để ph\x00e1t sinh]";
            this.glkInsuranceTableList.Properties.View = this.gridLookUpEdit1View;
            this.glkInsuranceTableList.Size = new Size(0x12f, 0x16);
            this.glkInsuranceTableList.StyleController = this.layoutControl1;
            this.glkInsuranceTableList.TabIndex = 10;
            this.glkInsuranceTableList.ButtonClick += new ButtonPressedEventHandler(this.glk_ButtonClick);
            this.gridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.colInsuranceTableListName });
            this.gridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridLookUpEdit1View.Name = "gridLookUpEdit1View";
            this.gridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.colInsuranceTableListName.Caption = "Đợt b\x00e1o c\x00e1o";
            this.colInsuranceTableListName.FieldName = "InsuranceTableListName";
            this.colInsuranceTableListName.Name = "colInsuranceTableListName";
            this.colInsuranceTableListName.Visible = true;
            this.colInsuranceTableListName.VisibleIndex = 0;
            this.dateEdit2.EditValue = null;
            this.dateEdit2.Location = new Point(0x6c, 0x7b);
            this.dateEdit2.Name = "dateEdit2";
            this.dateEdit2.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dateEdit2.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dateEdit2.Size = new Size(0x65, 20);
            this.dateEdit2.StyleController = this.layoutControl1;
            this.dateEdit2.TabIndex = 6;
            this.radioGroup2.Location = new Point(0x6c, 0x4a);
            this.radioGroup2.Name = "radioGroup2";
            this.radioGroup2.Properties.Appearance.BackColor = Color.Transparent;
            this.radioGroup2.Properties.Appearance.Options.UseBackColor = true;
            this.radioGroup2.Properties.BorderStyle = BorderStyles.NoBorder;
            this.radioGroup2.Properties.Items.AddRange(new RadioGroupItem[] { new RadioGroupItem(null, "Trả thẻ BHYT"), new RadioGroupItem(null, "Truy đ\x00f3ng bổ sung BHYT (do kh\x00f4ng trả thẻ)") });
            this.radioGroup2.Size = new Size(0x12f, 0x2b);
            this.radioGroup2.StyleController = this.layoutControl1;
            this.radioGroup2.TabIndex = 5;
            this.dtToDate.EditValue = null;
            this.dtToDate.Location = new Point(0x6c, 0x30);
            this.dtToDate.Name = "dtToDate";
            this.dtToDate.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtToDate.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtToDate.Size = new Size(0x12f, 20);
            this.dtToDate.StyleController = this.layoutControl1;
            this.dtToDate.TabIndex = 4;
            this.radioGroup1.Location = new Point(12, 12);
            this.radioGroup1.Name = "radioGroup1";
            this.radioGroup1.Properties.Appearance.BackColor = Color.Transparent;
            this.radioGroup1.Properties.Appearance.Options.UseBackColor = true;
            this.radioGroup1.Properties.BorderStyle = BorderStyles.NoBorder;
            this.radioGroup1.Properties.Items.AddRange(new RadioGroupItem[] { new RadioGroupItem(null, "Th\x00f4i việc (GH)"), new RadioGroupItem(null, "Nghỉ thai sản (TS)"), new RadioGroupItem(null, "Nghỉ ốm (OF)") });
            this.radioGroup1.Size = new Size(0x18f, 30);
            this.radioGroup1.StyleController = this.layoutControl1;
            this.radioGroup1.TabIndex = 0;
            this.txtDescription.Location = new Point(0x6c, 0x97);
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.Size = new Size(0x12f, 40);
            this.txtDescription.StyleController = this.layoutControl1;
            this.txtDescription.TabIndex = 7;
            this.txtDescription.TabStop = false;
            this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
            this.layoutControlGroup1.EnableIndentsWithoutBorders = DefaultBoolean.True;
            this.layoutControlGroup1.GroupBordersVisible = false;
            this.layoutControlGroup1.Items.AddRange(new BaseLayoutItem[] { this.layoutControlItem1, this.layoutControlItem2, this.layoutControlItem3, this.layoutControlItem4, this.layoutControlItem5, this.layoutControlItem6, this.layoutControlItem7 });
            this.layoutControlGroup1.Location = new Point(0, 0);
            this.layoutControlGroup1.Name = "layoutControlGroup1";
            this.layoutControlGroup1.Size = new Size(0x1a7, 0xeb);
            this.layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlGroup1.Text = "layoutControlGroup1";
            this.layoutControlGroup1.TextVisible = false;
            this.layoutControlItem1.Control = this.radioGroup1;
            this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
            this.layoutControlItem1.Location = new Point(0, 0);
            this.layoutControlItem1.Name = "layoutControlItem1";
            this.layoutControlItem1.Size = new Size(0x193, 0x22);
            this.layoutControlItem1.Text = "layoutControlItem1";
            this.layoutControlItem1.TextSize = new Size(0, 0);
            this.layoutControlItem1.TextToControlDistance = 0;
            this.layoutControlItem1.TextVisible = false;
            this.layoutControlItem2.Control = this.dtToDate;
            this.layoutControlItem2.CustomizationFormText = "Ng\x00e0y bắt đầu nghỉ:";
            this.layoutControlItem2.Location = new Point(0, 0x22);
            this.layoutControlItem2.Name = "layoutControlItem2";
            this.layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 4, 4);
            this.layoutControlItem2.Size = new Size(0x193, 0x1c);
            this.layoutControlItem2.Text = "Ng\x00e0y bắt đầu nghỉ:";
            this.layoutControlItem2.TextSize = new Size(0x5c, 13);
            this.layoutControlItem3.Control = this.radioGroup2;
            this.layoutControlItem3.CustomizationFormText = "C\x00f3 trả thẻ:";
            this.layoutControlItem3.Location = new Point(0, 0x3e);
            this.layoutControlItem3.Name = "layoutControlItem3";
            this.layoutControlItem3.Size = new Size(0x193, 0x2f);
            this.layoutControlItem3.Text = "C\x00f3 trả thẻ:";
            this.layoutControlItem3.TextSize = new Size(0x5c, 13);
            this.layoutControlItem4.Control = this.dateEdit2;
            this.layoutControlItem4.CustomizationFormText = "Ng\x00e0y trả thẻ:";
            this.layoutControlItem4.Location = new Point(0, 0x6d);
            this.layoutControlItem4.Name = "layoutControlItem4";
            this.layoutControlItem4.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 4, 4);
            this.layoutControlItem4.Size = new Size(0xc9, 0x1c);
            this.layoutControlItem4.Text = "Ng\x00e0y trả thẻ:";
            this.layoutControlItem4.TextSize = new Size(0x5c, 13);
            this.layoutControlItem5.Control = this.txtDescription;
            this.layoutControlItem5.CustomizationFormText = "layoutControlItem5";
            this.layoutControlItem5.Location = new Point(0, 0x89);
            this.layoutControlItem5.Name = "layoutControlItem5";
            this.layoutControlItem5.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 4, 4);
            this.layoutControlItem5.Size = new Size(0x193, 0x30);
            this.layoutControlItem5.Text = "Ghi ch\x00fa bổ sung:";
            this.layoutControlItem5.TextSize = new Size(0x5c, 13);
            this.layoutControlItem6.Control = this.glkInsuranceTableList;
            this.layoutControlItem6.CustomizationFormText = "Chọn đợt b\x00e1o c\x00e1o:";
            this.layoutControlItem6.Location = new Point(0, 0xb9);
            this.layoutControlItem6.Name = "layoutControlItem6";
            this.layoutControlItem6.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 4, 4);
            this.layoutControlItem6.Size = new Size(0x193, 30);
            this.layoutControlItem6.Text = "Chọn đợt b\x00e1o c\x00e1o:";
            this.layoutControlItem6.TextSize = new Size(0x5c, 13);
            this.btDecrease.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btDecrease.ImageIndex = 2;
            this.btDecrease.ImageList = this.imageCollection1;
            this.btDecrease.Location = new Point(0x4a, 0xfb);
            this.btDecrease.Name = "btDecrease";
            this.btDecrease.Size = new Size(130, 0x17);
            this.btDecrease.TabIndex = 1;
            this.btDecrease.Text = "Ph\x00e1t Sinh Giảm (>>)";
            this.btDecrease.Click += new EventHandler(this.btDecrease_Click);
            this.imageCollection1.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection1.ImageStream");
            this.imageCollection1.Images.SetKeyName(0, "ico_alpha_Search_16x16.png");
            this.imageCollection1.Images.SetKeyName(1, "ico_alpha_Delete_16x16.png");
            this.imageCollection1.Images.SetKeyName(2, "document2.png");
            this.imageCollection1.Images.SetKeyName(3, "open-16x16.png");
            this.imageCollection1.Images.SetKeyName(4, "direction_next.png");
            this.btClose.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btClose.ImageIndex = 1;
            this.btClose.ImageList = this.imageCollection1;
            this.btClose.Location = new Point(0x141, 0xfb);
            this.btClose.Name = "btClose";
            this.btClose.Size = new Size(0x59, 0x17);
            this.btClose.TabIndex = 2;
            this.btClose.Text = "Hủy (X)";
            this.btClose.Click += new EventHandler(this.btClose_Click);
            this.btNext.ImageIndex = 4;
            this.btNext.ImageList = this.imageCollection1;
            this.btNext.Location = new Point(0xd4, 0xfb);
            this.btNext.Name = "btNext";
            this.btNext.Size = new Size(0x65, 0x17);
            this.btNext.TabIndex = 5;
            this.btNext.Text = "Bỏ qua (>>)";
            this.btNext.Click += new EventHandler(this.btNext_Click);
            this.calRate.Location = new Point(0x135, 0x7b);
            this.calRate.Name = "calRate";
            this.calRate.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calRate.Size = new Size(0x66, 20);
            this.calRate.StyleController = this.layoutControl1;
            this.calRate.TabIndex = 13;
            this.layoutControlItem7.Control = this.calRate;
            this.layoutControlItem7.CustomizationFormText = "Tỷ lệ nộp bổ sung:";
            this.layoutControlItem7.Location = new Point(0xc9, 0x6d);
            this.layoutControlItem7.Name = "layoutControlItem7";
            this.layoutControlItem7.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 4, 4);
            this.layoutControlItem7.Size = new Size(0xca, 0x1c);
            this.layoutControlItem7.Text = "Tỷ lệ nộp bổ sung:";
            this.layoutControlItem7.TextSize = new Size(0x5c, 13);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x1ab, 0x11a);
            base.Controls.Add(this.btNext);
            base.Controls.Add(this.btClose);
            base.Controls.Add(this.btDecrease);
            base.Controls.Add(this.groupControl1);
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "xfmDecrease";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "L\x00fd do ngưng tham gia BHXH";
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.layoutControl1.EndInit();
            this.layoutControl1.ResumeLayout(false);
            this.glkInsuranceTableList.Properties.EndInit();
            this.gridLookUpEdit1View.EndInit();
            this.dateEdit2.Properties.VistaTimeProperties.EndInit();
            this.dateEdit2.Properties.EndInit();
            this.radioGroup2.Properties.EndInit();
            this.dtToDate.Properties.VistaTimeProperties.EndInit();
            this.dtToDate.Properties.EndInit();
            this.radioGroup1.Properties.EndInit();
            this.txtDescription.Properties.EndInit();
            this.layoutControlGroup1.EndInit();
            this.layoutControlItem1.EndInit();
            this.layoutControlItem2.EndInit();
            this.layoutControlItem3.EndInit();
            this.layoutControlItem4.EndInit();
            this.layoutControlItem5.EndInit();
            this.layoutControlItem6.EndInit();
            this.imageCollection1.EndInit();
            this.calRate.Properties.EndInit();
            this.layoutControlItem7.EndInit();
            base.ResumeLayout(false);
        }

        public void RaiseCreatedEventHander()
        {
            if (this.Created != null)
            {
                this.Created(this);
            }
        }

        private void SetValue(int Record)
        {
            this.m_EmployeeCode = this.dt_Employee.Rows[Record]["EmployeeCode"].ToString();
            this.m_EmployeeName = this.dt_Employee.Rows[Record]["FirstName"].ToString() + " " + this.dt_Employee.Rows[Record]["LastName"].ToString();
            this.m_Sex = bool.Parse(this.dt_Employee.Rows[Record]["Sex"].ToString());
            this.m_IDCard = this.dt_Employee.Rows[Record]["IDCard"].ToString();
            this.m_MainAddress = this.dt_Employee.Rows[Record]["MainAddress"].ToString();
            this.m_OldSalary = decimal.Parse(this.dt_Employee.Rows[Record]["InsuranceSalary"].ToString());
            this.m_OldAllowance1 = decimal.Parse(this.dt_Employee.Rows[Record]["Allowance1"].ToString());
            this.m_OldAllowance2 = decimal.Parse(this.dt_Employee.Rows[Record]["Allowance2"].ToString());
            this.m_OldAllowance3 = decimal.Parse(this.dt_Employee.Rows[Record]["Allowance3"].ToString());
            this.m_OldAllowance4 = decimal.Parse(this.dt_Employee.Rows[Record]["Allowance4"].ToString());
            this.m_NewSalary = 0M;
            this.m_NewAllowance1 = 0M;
            this.m_NewAllowance2 = 0M;
            this.m_NewAllowance3 = 0M;
            this.m_NewAllowance4 = 0M;
            this.m_Type = 2;
            this.m_IsPay = false;
            this.m_SocialInsuranceCode = this.dt_Employee.Rows[Record]["InsuranceCode"].ToString();
            this.m_HealthInsuranceCode = this.dt_Employee.Rows[Record]["HealthInsuranceCode"].ToString();
            this.m_Province = this.dt_Employee.Rows[Record]["Province"].ToString();
            this.m_Hospital = this.dt_Employee.Rows[Record]["Hospital"].ToString();
            this.calRate.EditValue = this.m_Rate = 0.0;
            this.m_ToDate = this.dtToDate.DateTime = System.DateTime.Now;
            this.m_Description = this.txtDescription.Text = "";
            this.m_Count--;
            if (this.m_Count < 0)
            {
                this.btNext.Enabled = false;
            }
            string[] strArray = new string[] { "Ph\x00e1t Sinh Giảm - ", this.m_EmployeeName, " (", this.m_EmployeeCode, ") - ", (this.m_Count + 1).ToString(), " mẫu tin đang đợi" };
            this.Text = string.Concat(strArray);
        }

        public delegate void CreatedEventHander(object sender);
    }
}

